home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Mac OS USB DDK_v1.0.1 / Tools / USBDDKBuildDriver < prev    next >
Encoding:
Text File  |  1998-09-03  |  3.2 KB  |  126 lines  |  [TEXT/MPS ]

  1. #
  2. #    File:        USBDDKBuildDriver
  3. #
  4. #    Contains:    Rules to invoke build of individual drivers.
  5. #
  6. #    Version:    xxx put version here xxx
  7. #
  8. #    Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  9. #
  10.  
  11. # this save/copy/restore of the USB environment variables is required so that 
  12. # the USB team can have both the USB build environment and the USB DDK
  13. # build environment installed
  14.  
  15. set -e USBTargetsTemp "{USBTargets}"
  16. set -e USBTargets "{USBDDKTargets}"
  17.  
  18. set -e USBObjectsTemp "{USBObjects}"
  19. set -e USBObjects "{USBDDKObjects}"
  20.  
  21. set -e USBLibrariesTemp "{USBLibraries}"
  22. set -e USBLibraries "{USBDDKLibraries}"
  23.  
  24. set -e USBBuildResultsTemp "{USBBuildResults}"
  25. set -e USBBuildResults "{USBDDKTargets}"
  26.  
  27. set -e USBReleaseExtensionsTemp "{USBReleaseExtensions}"
  28. set -e USBReleaseExtensions "{USBDDKReleaseExtensions}"
  29.  
  30. set -e USBMapDirTemp "{USBMapDir}"
  31. set -e USBMapDir "{USBDDKMapDir}"
  32.  
  33. set -e StubLibsDirTemp "{StubLibsDir}"
  34. set -e StubLibsDir "{USBDDKLibraries}"
  35.  
  36. set -e USBInterfacesInternalTemp "{USBInterfacesInternal}"
  37. set -e USBInterfacesInternal "{USBDDKInterfacesInternal}"
  38.  
  39. set -e USBInterfacesExternalTemp "{USBInterfacesExternal}"
  40. set -e USBInterfacesExternal "{USBDDKInterfacesExternal}"
  41.  
  42. unset USBInterfacesPrivate
  43.  
  44. Set t1 `Date -n`
  45. Set t0 "`Date -s`"
  46.  
  47. (Evaluate "`Directory`" =~ /≈':'≈':'(≈)®1':'/) ∑ dev:null
  48.  
  49. Echo "#******************************************************************************************************"
  50. Echo "# Building Driver: {®1}"
  51. echo "# "{t0}
  52.     
  53.     If `Exists "{USBDDKDriver}".make` == ''
  54.         Echo "#   The current directory is: "`Directory`;
  55.         Echo "#   This directory has no Makefile. Please set the directory to the driver directory"
  56.         Echo "#   you wish to build by selecting one of the drivers listed in the USBDDK menu."
  57.     Else
  58.         if {1} == 'clean'
  59.             set echo 0
  60.             set exit 1
  61.             Make -f {USBDDKDriver}.make clean > make.build
  62.             
  63.             set echo 0        
  64.             set exit 1
  65.             make.build || (Beep; set echo 0; Exit 1)
  66.             
  67.             set echo 0
  68.             set exit 1
  69.             Make -f {USBDDKDriver}.make > make.build
  70.             
  71.             set exit 1
  72.             set echo 1
  73.             make.build || (Beep; set echo 0; Exit 1)
  74.  
  75.             set echo 0
  76.             set exit 1
  77.         else
  78.             set echo 0
  79.             set exit 1
  80.             if {1} == 'full'
  81.                 Make -f {USBDDKDriver}.make -e > make.build
  82.             else
  83.                 Make -f {USBDDKDriver}.make> make.build
  84.             End
  85.             
  86.             set exit 1
  87.             set echo 1
  88.             make.build || (Beep; set echo 0; Exit 1)
  89.             
  90.             set echo 0
  91.             set exit 1
  92.         End
  93.     End
  94. #End
  95.  
  96. Set t2 `Date -n`
  97. Set t3 "`Date -s`"
  98.  
  99. echo "#   Started: "{t0}
  100. echo "# Completed: "{t3}
  101. echo "#"
  102.  
  103. Set t `Evaluate {t2} - {t1}`
  104. If {t} > 1
  105.     Echo "# Time to build driver: {t} seconds."
  106. Else
  107.     Echo "# Time to build driver: less than 1 second"
  108. End
  109. Echo "#******************************************************************************************************"
  110.  
  111. Delete -i Make.build
  112.  
  113. set -e USBTargets "{USBTargetsTemp}"
  114. set -e USBObjects "{USBObjectsTemp}"
  115. set -e USBRIncludes "{USBRIncludesTemp}"
  116. set -e USBLibraries "{USBLibrariesTemp}"
  117. set -e USBBuildResults "{USBBuildResultsTemp}"
  118. set -e USBReleaseExtensions "{USBReleaseExtensionsTemp}"
  119. set -e USBMapDir "{USBMapDirTemp}"
  120.  
  121. set -e USBInterfacesInternal "{USBInterfacesInternalTemp}"
  122. set -e USBInterfacesExternal "{USBInterfacesExternalTemp}"
  123. set -e USBInterfacesPrivate "{USBInterfacesPrivateTemp}"
  124.  
  125. set -e StubLibsDir "{StubLibsDirTemp}"
  126.